//
//  FeedBackTableViewCell.m
//  newProject
//
//  Created by 李航飞 on 2017/6/11.
//  Copyright © 2017年 李航飞. All rights reserved.
//

#import "FeedBackTableViewCell.h"

@implementation FeedBackTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUpView];
        _rightImageView = [[UIImageView alloc]init];
        _rightImageView.image = [UIImage imageNamed:@"箭头"];
        [self.contentView addSubview:_rightImageView];

        [_rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView.mas_right).offset(-15/WIDTH_6_SCALE);
            make.centerY.equalTo(self.contentView.mas_centerY).offset(0);
        }];

    }
    return self;
}


- (void)setUpView{
    
    UIImageView *leftImageView = [[UIImageView alloc] init];
//    leftImageView.backgroundColor = [UIColor redColor];
    self.leftImageView = leftImageView;
    
    [self addSubview:leftImageView];
    
    
    UILabel *titleLable = [[UILabel alloc] init];
    self.titleLable = titleLable;
    titleLable.font = [UIFont systemFontOfSize:14*kScrenWidth];
    [self addSubview:titleLable];
    titleLable.textAlignment = NSTextAlignmentLeft;
    
    UILabel *detailLable = [[UILabel alloc] init];
    self.detailLable = detailLable;
    self.detailLable.textAlignment = NSTextAlignmentLeft;
    self.detailLable.font = [UIFont systemFontOfSize:12*kScrenWidth];
    [_detailLable setTextColor:INPUT_COLOR];
    [self addSubview:detailLable];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    if (_isBig) {
//        _leftImageView.layer.cornerRadius = 25*kScrenWidth;
//        [_leftImageView.layer setMasksToBounds:YES];
        _leftImageView.frame = CGRectMake(15*kScrenWidth, 25*kScrenHidth, 30*kScrenWidth, 31*kScrenWidth);
        _titleLable.frame = CGRectMake(60*kScrenWidth, 20*kScrenHidth, 150*kScrenWidth, 20*kScrenHidth);
        _detailLable.frame = CGRectMake(60*kScrenWidth, 50*kScrenHidth, 180*kScrenWidth, 20*kScrenHidth);
    }else{
//        _leftImageView.layer.cornerRadius = 15*kScrenWidth;
//        [_leftImageView.layer setMasksToBounds:YES];
        _leftImageView.frame = CGRectMake(15*kScrenWidth, 20*kScrenHidth, 30*kScrenWidth, 31*kScrenWidth);
        
        _titleLable.frame = CGRectMake(60*kScrenWidth, 20*kScrenHidth, 200*kScrenWidth, 20*kScrenHidth);
        
        _detailLable.frame = CGRectMake(60*kScrenWidth, 40*kScrenHidth, 280*kScrenWidth, 18*kScrenHidth);
    }
    
   
    
}






@end
